package chapters21;

import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.List;

/**
 * Created by xinxuchu on 2020/2/20.
 */
public class test {


    public int age = 13;

    public String username = "xinxuchu";

    private String password = "1123456";

    public void test(){
        System.out.println("aaaaaaaaaaaaa");
    }

    private void secrity(){
        System.out.println("secrty!");
    }

    private void test2(int age,String username){
        System.out.println(username+"的年纪是："+age);
    }

    public static void main(String[] args) {

        try {
            List<String> obj = Arrays.asList(new String[]{"老妈","编程"});
            Class<?> cls = obj.getClass();
            for (Field f:cls.getDeclaredFields()){
                f.setAccessible(true);
                System.out.println(f.getName()+"-"+f.get(obj));
            }
        }catch (IllegalAccessException e){
        }

    }
}
